﻿namespace WebPacker.Filters
{
	using dotless.Core;
	using dotless.Core.configuration;
	using WebPacker.Filters;
	using WebPacker.Packs;

	public class DotLessFilter : IFilter
	{
		private static readonly EngineFactory engineFactory = new EngineFactory(new DotlessConfiguration
		{
			CacheEnabled = false,
			MinifyOutput = false
		});

		public string Name { get; set; }

		public PackType PackType
		{
			get { return PackType.Css; }
		}

		public string Apply(string content)
		{
			return engineFactory.GetEngine().TransformToCss(content, null);
		}

		public string ApplyToCombined(string combinedContent)
		{
			return combinedContent;
		}
	}
}